﻿<%@ Page Language="C#" MasterPageFile="~/user.master" AutoEventWireup="true" Inherits="MediaMonitor.Users.Report_Outdoorplanning"
    Theme="default" Title="Report - Planning" CodeBehind="report-outdoorplanning.aspx.cs" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
    <link href="../rad-scripts/Grid.MyCustomSkin.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="Server">
    <iframe id="frmDownload" width="1 " height="1" frameborder="0"></iframe>
    <script type="text/javascript">
        function GetDownload(odid) {
            var iframe = document.getElementById("frmDownload");
            iframe.src = "../sitefiles/downloadPlanning.aspx?odid=" + odid;
        }
    </script>
    <asp:UpdatePanel ID="pnlUpdate" runat="server">
        <ContentTemplate>
            <table align="center" width="100%">
                <tr>
                    <td width="30%" align="right">
                        <b>Advertiser:</b>
                    </td>
                    <td>
                        <asp:Label ID="lblAedvrtiser" runat="server"></asp:Label>
                    </td>
                    <tr>
                        <td align="right">
                            <b>Product:</b>
                        </td>
                        <td>
                            <asp:Label ID="lblProduct" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <b>Sector:</b>
                        </td>
                        <td>
                            <asp:Label ID="lblSector" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <b>Sub Sector:</b>
                        </td>
                        <td>
                            <asp:Label ID="lblSubSector" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <b>Category:</b>
                        </td>
                        <td>
                            <asp:Label ID="lblCatagory" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <b>Total Cost:</b>
                        </td>
                        <td>
                            <asp:Label ID="lblTotalCost" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <b>Total Vehicles:</b>
                        </td>
                        <td>
                            <asp:Label ID="lblTotalVehicle"  runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <b>From Date:</b>
                        </td>
                        <td>
                            <asp:Label ID="lblFromDate" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <b>To Date:</b>
                        </td>
                        <td>
                            <asp:Label ID="lblToDate" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <b>Number Of Days:</b>
                        </td>
                        <td>
                            <asp:Label ID="lblnUMBERoFdAYS" runat="server"></asp:Label>
                        </td>
                    </tr>
            </table>
            <div style="text-align: right; padding-right: 10px; padding-bottom: 10px;">
                <asp:Button ID="btnExport" runat="server"  Text="Export" OnClick="btnExport_Clicked" />
            </div>
            <div id="InnerDIV" runat="server">
                <br />
                <telerik:RadGrid ID="radGrid" runat="server" AllowPaging="True" AutoGenerateColumns="false"
                    AllowSorting="True" GridLines="Both" ShowGroupPanel="True" PageSize="20" ItemStyle-Font-Size="8"
                    EnableEmbeddedSkins="false" Skin="MyCustomSkin" PagerStyle-FirstPageText="First"
                    PagerStyle-LastPageText="Last" PagerStyle-NextPageText="Next" PagerStyle-PrevPageText="Previous"
                    PagerStyle-VerticalAlign="Middle" EnableEmbeddedBaseStylesheet="False" OnNeedDataSource="radGrid_NeedDataSource"
                    OnItemDataBound="radGrid_ItemDataBound">
                    <MasterTableView Name="Report" ShowFooter="true" ItemStyle-BorderWidth="1" DataKeyNames="MediaTypeCode,MediaName, StreetGraph">
                        <FooterStyle Font-Bold="true" ForeColor="AliceBlue" />
                        <GroupHeaderItemStyle Font-Bold="true" Font-Size="Larger" />
                        <AlternatingItemStyle Font-Size="Smaller" />
                        <ItemStyle Font-Size="Smaller" />
                        <Columns>
                          <%--  <telerik:GridBoundColumn DataField="DateAdded" HtmlEncode="false" DataFormatString="{0:d}"
                                HeaderText="Date" UniqueName="DateAdded" ItemStyle-Font-Size="7" HeaderStyle-Width="80px" />--%>
                            <telerik:GridTemplateColumn HeaderText="Avenue" ItemStyle-Width="35" UniqueName="Media">
                                <ItemTemplate> 
                                <asp:Label ID="lblMediaHidden" runat="server" Visible="false" ForeColor="Maroon" Font-Size="Large" Font-Bold="true"></asp:Label>
                                    <asp:Label ID="lblMedia" runat="server" Text='<%#Eval("[MediaName]")%>'></asp:Label>
                                    <%--  <asp:Label ID="lblMediaHidden" runat="server" Text="**AVENIDA NO MONITOREADA POR AGB**" Visible="false" Font-Bold="true"></asp:Label>--%>
                              
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                          
                            <telerik:GridTemplateColumn HeaderText="Average Vehicle" ItemStyle-Width="35" ItemStyle-Font-Size="7"
                                HeaderStyle-Width="80px" UniqueName="AverageVehicle">
                                <ItemTemplate>
                                    <asp:Label ID="lblAverageVehicle" runat="server" Text=' <%#Eval("AverageVehicle") == "0.00" ? string.Empty : String.Format("{0:###,###.##}", DataBinder.Eval(Container.DataItem, "AverageVehicle"))%> '></asp:Label>
                               <asp:Label ID="lblAverageVehicleHidden" Visible="false" runat="server" Text=' <%#Eval("AverageVehicle")%> '></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                          
                               <telerik:GridTemplateColumn HeaderText="Carrier" UniqueName="Carrier" ItemStyle-Font-Size="7"
                                HeaderStyle-Width="120px">
                                <ItemTemplate>
                                    <asp:Label ID="lblCarrier" runat="server"></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>

                            <telerik:GridTemplateColumn HeaderText="Billboards Type" UniqueName="BillboardsType"
                                ItemStyle-Font-Size="7" HeaderStyle-Width="120px">
                                <ItemTemplate>
                                    <asp:Label ID="lblBillboardsTYpe" runat="server"></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        
                          <telerik:GridTemplateColumn HeaderText="Negotiated Price($)" UniqueName="NegotiatedPrice"
                                ItemStyle-Font-Size="7" HeaderStyle-Width="80px">
                                <ItemTemplate>
                                    <asp:Label ID="lblNegotiatedPrice" runat="server"></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>

                            <telerik:GridTemplateColumn HeaderText="Billboards Quantity" UniqueName="Billboardsquantity"
                                ItemStyle-Font-Size="7" HeaderStyle-Width="70px">
                                <ItemTemplate>
                                    <asp:Label ID="lblBillboardsQuantity" runat="server"></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                           
                            <telerik:GridTemplateColumn HeaderText="Total Vechile" UniqueName="TotalVehicle"
                                ItemStyle-Font-Size="7" HeaderStyle-Width="80px">
                                <ItemTemplate>
                                    <asp:Label ID="lblTotalVehicle"   runat="server"></asp:Label>
                                     <asp:Label ID="lblTotalVehicleHidden" Visible="false"  runat="server"></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Daily Cost" UniqueName="DailyCost" ItemStyle-Font-Size="7"
                                HeaderStyle-Width="50px">
                                <ItemTemplate>
                                    <asp:Label ID="lblDailyCost" runat="server"></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Total Cost" UniqueName="TotalCost" ItemStyle-Font-Size="7"
                                HeaderStyle-Width="50px">
                                <ItemTemplate>
                                    <asp:Label ID="lblTotalCost" runat="server"></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="true" ReorderColumnsOnClient="true">
                        <Resizing AllowColumnResize="true" />
                    </ClientSettings>
                </telerik:RadGrid>
            </div>
            <br />
            <br />
              <span id="spnStars" visible="false" runat="server" style="font-size:large; color:Maroon; font-weight:bold;">**</span>   <asp:Label Visible="false" ID="lblExceptionalCase" Text="AVENIDA NO MONITOREADA POR AGB" runat="server" Font-Bold="true"></asp:Label>
            <center><b><span style="font-size:12px;">TOTAL VEHICLE</span></b></center>
       
            <asp:Chart ID="ChartAvenue" runat="server" Height="450px" Width="800px" BackImageTransparentColor="White"
                Palette="Bright" Font="Segoe UI, 8pt">
                <Series>
                    <asp:Series Name="Series1" CustomProperties="DrawingStyle=Cylinder, LabelStyle=Bottom, MaxPixelPointWidth=40"
                        LabelAngle="-90" LabelFormat="{0:###,###}" IsValueShownAsLabel="True" XValueMember="SelectedAvenue" YValueMembers="TotalVehicles"
                       Palette="Pastel" Legend="Legend1" LabelForeColor="White" Font="Segoe UI, 10pt, style=Bold"
                        LabelBackColor="Transparent">
                    </asp:Series>
                </Series>
                <ChartAreas>
                    <asp:ChartArea Name="ChartArea1" >
                        <AxisY IsLabelAutoFit="true">
                          <MajorGrid Enabled="false" />
                            <LabelStyle Format="{0:#,##,###}" Font="Segoe UI,1px" ForeColor="Black" />
                        </AxisY>
                        <AxisX IsLabelAutoFit="False">
                            <LabelStyle  Font="Segoe UI, 10.25pt, style=Italic" ForeColor="Black" />
                            <MajorGrid Enabled="false" />
                        </AxisX >
                        <Area3DStyle LightStyle="Realistic" />
                    </asp:ChartArea>
                </ChartAreas>
              
            </asp:Chart>
            <asp:ObjectDataSource ID="objDS" runat="server" TypeName="MediaMonitor.Common.ReportFuncs"
                SelectMethod="GetReportPlanning_Paged" SelectCountMethod="GetReportPlanning_RowCount"
                EnablePaging="true" StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows"
                SortParameterName="sortColumn" OnSelecting="ObjDS_Selecting">
                <SelectParameters>
                    <asp:Parameter Name="userID" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="sDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="eDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="mediaTypeCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="mediaCodes" Type="String" DefaultValue="" ConvertEmptyStringToNull="true" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="objDSExport" runat="server" TypeName="MediaMonitor.Common.ReportFuncs"
                SelectMethod="GetReportPlanning_Export" SelectCountMethod="GetReportPlanning_RowCountExport"
                EnablePaging="true" StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows"
                SortParameterName="sortColumn" OnSelecting="ObjDS_SelectingExport">
                <SelectParameters>
                    <asp:Parameter Name="userID" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" />
                    <asp:Parameter Name="sDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="eDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="mediaTypeCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="mediaCodes" Type="String" DefaultValue="" ConvertEmptyStringToNull="true" />
                </SelectParameters>
            </asp:ObjectDataSource>
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="btnExport" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
